package com.atguigu.gulimall.config;

import com.atguigu.gulimall.interceptor.CartInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author ming
 * @create 2022/5/5
 * @description:
 */
@Configuration
public class MyWebConfig implements WebMvcConfigurer {
    @Override

    public void addInterceptors(InterceptorRegistry registry){
        //拦截所有请求
        registry.addInterceptor(new CartInterceptor()).addPathPatterns("/**");

    }
}
